package J20241106_prefix_and;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 前缀和
 * User: 王圆豪
 * Date: 2024-11-06
 * Time: 20:24
 */
public class Prefix_and {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr1 = new int[n + 1];
        int[] s = new int[n + 1];
        for (int i = 1; i < n + 1; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 1; i < n + 1; i++) {
            s[i] = s[i - 1] + arr1[i];
        }
        int l = sc.nextInt();
        int r = sc.nextInt();
        System.out.println(s[r] - s[l - 1]);
    }
}
